mini.parse();
var form = new mini.Form("form1");
var radioData = [
    {"id": "0", "text": "是"},
    {"id": "1", "text": "否"},
]


$(function () {
    var radio = mini.get("radioId")
    radio.setData(radioData)
    document.getElementById("trId").hidden
})



function request() {
    $.ajax({
        url:"",
        type:"post",
        success:function (data) {
            column3.setData();
        },
        success:function (data) {

        }
    })
}


function onSave() {
    // form.validate();
    // if (form.isValid() == false) return;
    var aaa = form.getData();
    aaa = JSON.stringify(aaa);
    $.ajax({
        url: ajaxUrl+"/docFolder/saveDocFolder.do",
        contentType: "application/json",
        type: "post",
        data: aaa,
        success: function (data) {//请求成功完成后要执行的方法
            console.log(data);
            mini.alert(data.msg)
        },
        error: function (data) {
            mini.alert(data.msg);
        }
    })
}


//点击确定
function onOk() {
    onSave();
    closeWindow("new");
}
//点击取消
function onCancel() {
    closeWindow("cancel");
}

function GetData() {
    mini.parse();
    var form = new mini.Form("form1");
    var o = form.getData();         //form用getData能获取到子页面上的数据
    return o;                       //返回数据
}

function closeWindow(action) {
    if (window.CloseOwnerWindow)
        return window.CloseOwnerWindow(action);
    else
        window.close();
}

function SetData(data){
    data = mini.clone(data);       //将父页面传过来的值深克隆一下
    console.log(data.row);
    if(data.action=="edit"){      //当状态是edit的时候
        var id=data.row.folderId        //打点调用你获取要用的ID参数下面换成正确额得接口调用
        console.log(id);
        $.ajax({
            url: ajaxUrl+"/docFolder/queryById.do?id="+id,
            contentType: "application/json",
            type: "post",
            success: function (data) {//请求成功完成后要执行的方法
                console.log(data);
                form.setData(data.obj);     //form用setData得到数据添加到框里
            },
            error: function (data) {
                mini.alert(data.msg);
            }
        })
    }else if(data.action=="new"){

    }
}

